/*     */ package dm.jdbc.pool;
/*     */ 
/*     */ import java.util.Hashtable;
/*     */ import javax.naming.Context;
/*     */ import javax.naming.Name;
/*     */ import javax.naming.Reference;
/*     */ import javax.naming.StringRefAddr;
/*     */ import javax.naming.spi.ObjectFactory;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class DmdbDataSourceFactory_bs
/*     */   implements ObjectFactory
/*     */ {
/*  33 */   protected final String dataSourceClassName = "dm.jdbc.pool.DmdbDataSource_bs";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*  38 */   protected final String poolDataSourceName = "dm.jdbc.pool.DmdbConnectionPoolDataSource_bs";
/*     */   
/*  40 */   protected final String connectionCacheImpl = "dm.jdbc.pool.DmdbConnectionCache_bs";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable env)
/*     */     throws Exception
/*     */   {
/*  61 */     Reference ref = (Reference)obj;
/*  62 */     Object retObject = null;
/*  63 */     String className = ref.getClassName();
/*     */     
/*  65 */     if (className.equals("dm.jdbc.pool.DmdbDataSource_bs")) {
/*  66 */       retObject = new DmdbDataSource_bs();
/*  67 */     } else if (className.equals("dm.jdbc.pool.DmdbConnectionPoolDataSource_bs")) {
/*  68 */       retObject = new DmdbConnectionPoolDataSource_bs();
/*  69 */     } else if (className.equals("dm.jdbc.pool.DmdbConnectionCache_bs")) {
/*  70 */       retObject = new DmdbConnectionCache_bs();
/*     */     }
/*     */     
/*  73 */     if (retObject != null) {
/*  74 */       DmdbDataSource_bs ds = (DmdbDataSource_bs)retObject;
/*  75 */       StringRefAddr stringRefAddr = null;
/*     */       
/*  77 */       if ((stringRefAddr = (StringRefAddr)ref.get("host")) != null) {
/*  78 */         ds.setServer((String)stringRefAddr.getContent());
/*     */       }
/*     */       
/*  81 */       if ((stringRefAddr = (StringRefAddr)ref.get("port")) != null) {
/*  82 */         String port = (String)stringRefAddr.getContent();
/*  83 */         ds.setPort(Integer.parseInt(port));
/*     */       }
/*     */       
/*  86 */       if ((stringRefAddr = (StringRefAddr)ref.get("url")) != null) {
/*  87 */         ds.setURL((String)stringRefAddr.getContent());
/*     */       }
/*     */       
/*  90 */       if ((stringRefAddr = (StringRefAddr)ref.get("user")) != null) {
/*  91 */         ds.setUser((String)stringRefAddr.getContent());
/*     */       }
/*     */       
/*  94 */       if ((stringRefAddr = (StringRefAddr)ref.get("password")) != null) {
/*  95 */         ds.setPassword((String)stringRefAddr.getContent());
/*     */       }
/*     */       
/*  98 */       if ((stringRefAddr = (StringRefAddr)ref.get("dbname")) != null) {
/*  99 */         ds.setDatabase((String)stringRefAddr.getContent());
/*     */       }
/*     */       
/*     */ 
/* 103 */       if (className.equals("dm.jdbc.pool.DmdbConnectionCache_bs")) {
/* 104 */         DmdbConnectionCache_bs cache = (DmdbConnectionCache_bs)retObject;
/*     */         
/* 106 */         if ((stringRefAddr = (StringRefAddr)ref.get("minLimit")) != null) {
/* 107 */           cache.setMinLimit(Integer.parseInt(
/* 108 */             (String)stringRefAddr.getContent()));
/*     */         }
/*     */         
/* 111 */         if ((stringRefAddr = (StringRefAddr)ref.get("maxLimit")) != null) {
/* 112 */           cache.setMaxLimit(Integer.parseInt(
/* 113 */             (String)stringRefAddr.getContent()));
/*     */         }
/*     */         
/* 116 */         if ((stringRefAddr = (StringRefAddr)ref.get("cacheScheme")) != null) {
/* 117 */           cache.setCacheScheme(
/* 118 */             Integer.parseInt((String)stringRefAddr.getContent()));
/*     */         }
/*     */       }
/*     */       
/* 122 */       return ds;
/*     */     }
/*     */     
/* 125 */     return retObject;
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\pool\DmdbDataSourceFactory_bs.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */